package com.hooya.fa.eu.biz.dao.mapper;

import com.hooya.fa.eu.api.bo.stk.HistoryBelongsBO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description 1
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2024/1/31
 * @Version 1.0.0
 */
@Mapper
public interface TempMapper {

    /**
     * 获取delivery_goods重复数据的id列表
     *
     * @return
     */
    @Select("select ID from deliver_goods GROUP BY ID HAVING count(ID) > 1")
    List<String> getRepeatId();

    @Delete("DELETE from deliver_goods where id = #{id} LIMIT 1")
    int deleteDistinctData(@Param("id") String id);

    @Delete("DELETE from deliver_goods where id = #{id} and IsDelete = 1 LIMIT 1")
    int deleteDistinctDataByDelete(String id);

    @Delete("DELETE from deliver_goods where id = #{id} and IsPrint = 0 LIMIT 1")
    int deleteDistinctDataByPrint(String id);

    /**
     * 获取delivery_goodssheet重复数据的id列表
     *
     * @return
     */
    @Select("select ID from deliver_goodssheet GROUP BY ID HAVING count(ID) > 1")
    List<String> getSheetRepeatId();

    @Delete("DELETE from deliver_goodssheet where ID = #{id} and Status = #{status} LIMIT 1")
    int deleteDistinctSheetData(@Param("id") String id, @Param("status") Integer status);

    /**
     * 获取历史进仓转运退货和23年3月后转运数据
     *
     * @return
     */
    List<HistoryBelongsBO> getHistoryJcZyBelong();

    List<HistoryBelongsBO> getHistoryJcZyBelongDaily();

    /**
     * 获取23年3月后退货数据
     *
     * @return
     */
    List<HistoryBelongsBO> getTempThBelongs();

    List<HistoryBelongsBO> getTempThBelongsDaily();
}
